﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace System
{
    public static class GuidExtension
    {
        public static bool IsEmpty(this Guid value)
        {
            return value == Guid.Empty;
        }

        public static bool IsEmpty(this Guid? value)
        {
            if (value != null)
                return ((Guid)value).IsEmpty();

            return false;
        }

        public static bool IsInvalidKey(this Guid value)
        {
            return value.IsEmpty();
        }
        /// <summary>
        /// 数组改单行
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public static string Inline(this IEnumerable<Guid> input)
        {
            if (input == null || !input.Any())
            {
                return null;
            }
            return "'" + string.Join("','", input) + "'";
        }
    }
}
